package com.mp.approvalreq.common;

import java.io.Serializable;
import java.util.Objects;


public class ResultBean<T> implements Serializable {

    private static final long serialVersionUID = -1L;

    private static final String SUCCESS = "0";
    private static final String SUCCESS_DESC = "成功";

    private String result;
    private String res_info;

    private T data;     // 有些数据返回的是data
    private T item;     // 有些数据返回的是item

    public ResultBean(String name, T obj) {
        this.result = SUCCESS;
        this.res_info = SUCCESS_DESC;
        if (Objects.equals(name, "data")) {
            this.data = obj;
        } else if (Objects.equals(name, "item")) {
            this.item = obj;
        }
    }

    public ResultBean() {
        this.result = SUCCESS;
        this.res_info = SUCCESS_DESC;
    }


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public T getItem() {
        return item;
    }

    public void setItem(T item) {
        this.item = item;
    }
	
}
